package kali.wpj.kali.util;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;

/**
 * Created by Server on 2015/5/11.
 */
public class EvaluationTranslationTools {
    public static String toTranlattion(String replaceWord) {
        HashMap<String, Object> replaceWordMap = setData();
        Set set = replaceWordMap.keySet();
        Iterator iter = set.iterator();
        while (iter.hasNext()) {
            String key = (String) iter.next();
            replaceWord = replaceWord.replace(key, replaceWordMap.get(key).toString());
            System.out.println("替换" + replaceWord);
        }


        return replaceWord.replace("\\n","-");
    }

    /**
     * 设置要替换的单词
     */

    public static HashMap<String, Object> setData() {
        HashMap<String, Object> replaceWord = new HashMap<String, Object>();
        replaceWord.put("Target IP", "目标IP地址");
        replaceWord.put("Target hostname", "目标主机名");
        replaceWord.put("Target Port", "目标端口");
        replaceWord.put("HTTP Server", "目标服务器名");
        replaceWord.put("Site Link", "网站链接");
        replaceWord.put("Name", "网站名");
        replaceWord.put("(IP)", "(IP地址)");
        replaceWord.put("HTTP Method", "Http请求方法");
        replaceWord.put("Description", "描述");
        replaceWord.put("Start Time", "开始时间");
        replaceWord.put("End Time", "结束时间");
        replaceWord.put("Elapsed Time", "用时：");
        replaceWord.put("Statistics", "统计");
        replaceWord.put("seconds", "秒");
        replaceWord.put("requests", "个请求");
        replaceWord.put("errors", "错误");
        replaceWord.put("findings", "个发现");


        return replaceWord;
    }

}
